export const getModel = () => ({
  'componentProps.multiple': false,
  commonSelectRangeValue: [],
  'componentProps.required': false,
  'componentProps.filterable': false
})

export const getSchema = () => ({
  type: 'object',
  properties: {
    'componentProps.multiple': {
      type: 'boolean',
      description: '是否多选'
    },
    commonSelectRangeValue: {
      type: 'array',
      description: '控制范围'
    },
    'componentProps.required': {
      type: 'boolean',
      description: '必填项'
    },
    'componentProps.filterable': {
      type: 'boolean',
      description: '搜索选项'
    }
  }
})

export const getUiSchema = () => [
  {
    title: '高级',
    type: 'group',
    children: [
      {
        label: '类型',
        type: 'select',
        modelKey: 'componentProps.multiple',
        items: [
          { label: '单选', value: false },
          { label: '多选', value: true }
        ]
      },
      {
        label: '控制范围',
        type: 'custom-change',
        modelKey: 'commonSelectRangeValue',
        component: 'BISelectRange'
      },
      // {
      //   label: '数据来源',
      //   type: 'custom-change',
      //   component: 'BISelectData'
      // },
      // {
      //   label: '默认值',
      //   type: 'custom-change',
      //   component: 'BISelectDefaultValue'
      // },
      {
        type: 'checkbox-group',
        items: [
          {
            label: '设为必填项',
            type: 'checkbox',
            modelKey: 'componentProps.required'
          },
          {
            label: '搜索选项',
            type: 'checkbox',
            modelKey: 'componentProps.filterable'
          }
        ]
      }
    ]
  }
]
